﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CBE.Services;
using CBE.Model;
using CBE.Model.Entities;
using Common.UI.EM.Views;
using Common.UI.EM.Views.Interfaces;
using System.Windows;

namespace CBE.UI.Control
{
    public class AdministarTurnosListPresentationModel : ListPresentationModel<AdministrarTurnosService, Turnos, AdministrarTurnosCriteria, AdministrarTurnosView>
    {

        public AdministrarTurnosService AdministrarTurnosService
        {
            get { return (AdministrarTurnosService)this.EntityManager; }
        }

        public override string DeleteLabel
        {
            get
            {
                return "Cancelar";
            }
        }
        public AdministarTurnosListPresentationModel(IListView listView)
            : base(listView)
        {
        }

        protected override bool ValidateOnDelete()
        {
            if (MessageBox.Show("¿Está seguro que desea cancelar el turno?", "Confirmación", MessageBoxButton.YesNo) == MessageBoxResult.No)
            {
                return false;
            }
            return true;
        }

        protected override void DeleteEntity()
        {
            AdministrarTurnosService.Cancelar(this.View.GetSelectedEntity());
        }
    }
}
